define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'apply.user_sign/index',
        add_url: 'apply.user_sign/add',
        edit_url: 'apply.user_sign/edit',
        delete_url: 'apply.user_sign/delete',
        modify_url: 'apply.user_sign/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                toolbar : ['refresh'],
                defaultToolbar:['filter', {
                    title: '搜索',
                    layEvent: 'TABLE_SEARCH',
                    icon: 'layui-icon-search',
                    extend: 'data-table-id="' + 'user_sign' + '"'
                }],
                cols: [[
                    {type: "checkbox"},
                    {field: 'username', minWidth: 80, title: '用户名'},
                    {field: 'add_time', minWidth: 80, title: '签到时间',search: 'range'},
                    {field: 'today', minWidth: 80, title: '今天签到次数',search:false},
                    {field: 'total', minWidth: 80, title: '总签到次数',search:false},
                ]],
            });

            

            ea.listen();
        },
    };
    return Controller;
});